import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/credentials/list',
    method: 'get',
    params: query
  })
}

export function updatecredentials(data) {
  return request({
    url: '/credentials/update/',
    method: 'post',
    data
  })
}

export function delcredentials(customer_id) {
  return request({
    url: '/credentials/delete/' + customer_id,
    method: 'get'
  })
}

export function fetchcustomer(id) {
  return request({
    url: '/customer/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/customer/pv',
    method: 'get',
    params: { pv }
  })
}

export function createcustomer(data) {
  return request({
    url: '/credentials/create',
    method: 'post',
    data
  })
}

export function getAllCustomer() {
  return request({
    url: '/customer/getAll',
    method: 'post'
  })
}
